package com.jiahua.admin.biz.action.customer;

import java.util.List;

import org.apache.log4j.Logger;

import com.jiahua.user.biz.model.Customer;
import com.jiahua.user.biz.service.CustomerService;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class MemberListAction extends ActionSupport {

	private static final long serialVersionUID = -1588256984228637681L;

	Logger log = Logger.getLogger(MemberListAction.class.getClass());

	CustomerService customerService;

	private List<Customer> customerList;

	public List<Customer> getCustomerList() {
		return customerList;
	}

	public void setCustomerList(List<Customer> customerList) {
		this.customerList = customerList;
	}

	public void setCustomerService(CustomerService customerService) {
		this.customerService = customerService;
	}

	@Override
	public String execute() throws Exception {
		// HttpServletRequest request = ServletActionContext.getRequest();
		customerList = getMemberList();
		return Action.SUCCESS;
	}

	private List<Customer> getMemberList() {
		List<Customer> list = customerService.listCustomer(200);
	    System.out.println("list.size() : " + list.size());
		return list;
	}
}
